contacts = ["小明", "小红", "小刚", "小强", "小李"]
subject = "数学"

print("\n-------------字符串拼接---------------")
for name in contacts:
    message = name + "，明天有" + subject + "课，请记得带" + subject + "课本。"
    print(message)

print("\n-------------参数位置---------------")
for name in contacts:
    message = "{0}，明天有{1}课，请记得带{1}课本。".format(name, subject)
    print(message)

print("\n--------------参数名称--------------")
for name in contacts:
    message = "{current_name}，明天有{current_subject}课，请记得带{current_subject}课本。".format(current_subject=subject, current_name=name)
    print(message)


print("\n--------------同名参数--------------")
for name in contacts:
    message = "{name}，明天有{subject}课，请记得带{subject}课本。".format(subject=subject, name=name)
    print(message)


print("\n--------------f字符串--------------")
for name in contacts:
    message = f"{name}，明天有{subject}课，请记得带{subject}课本。"
    print(message)


print("\n--------------gpa--------------")
gpa_dict = {"小明": 3.561, "小红": 2.579, "小刚": 3.672, "小强": 3.435, "小李": 3.567}
for name, gps in gpa_dict.items():
    print(f"{name}的GPA是{gps:.2f}")